<?php

class ValidatorController extends Controller{

    function actionAjax_callfunction(){
        $objectfunction = Yii::app()->request->getPost('FUNC');
        $val_num = Yii::app()->request->getPost('VAL_NUM');

        $agrs = array();
        for($i=0; $i<$val_num; $i++){
            switch(Yii::app()->request->getPost('VAL'.$i)){
                case 'null':
                    $agrs[] = NULL;
                    break;
                case 'true':
                    $agrs[] = TRUE;
                    break;
                case 'false':
                    $agrs[] = FALSE;
                    break;
                default:
                    $agrs[] = Yii::app()->request->getPost('VAL'.$i);
            }
        }
        $val = new ValidatorComponent();
        echo $val->callFunction($objectfunction, $agrs);
        die();
    }

}